import useAdvancement from "@/hooks/useAdvancement";
import getTranslateByKey, { type LangType } from "@/utils/getTranslateByKey";

export default async function (id: string, lang: LangType = 'zh_cn') {
  if (id.startsWith("providencraft:")) {
    id = id.replace(
      /providencraft:(.*)\//, "");
  }

  return await getTranslateByKey(useAdvancement(id).display?.title.translate ?? "", lang)
}